package com.rao.quartz.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.rao.quartz.mapper.memberMapper;
import com.rao.quartz.pojo.info_member;
import com.rao.quartz.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
 * @Author: raoguang
 * @Date: 2022/07/14/23:43
 * @Description:
 */
@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private memberMapper memberMapper;

    /**
     * 通过姓名获取多条用户信息
     *
     * @param
     * @return
     */
    @Override
    public List<info_member> getUserInfoByUserName(String name) {
        //链式查询的方式
        List<info_member> infoMembers = new LambdaQueryChainWrapper<>(memberMapper)
                .eq(info_member::getName, name)   //查询info_member表中name于传来的形参name相等的值
                .or()
                .gt(info_member::getAge, 19)   //great than 年龄大于19岁的数据
                .list();
        return infoMembers;
    }

    @Override
    public List<info_member> getInnerSql() {

        return null;
    }

    @Override
    public boolean save(info_member info_member) {
        return false;
    }

    @Override
    public boolean saveBatch(Collection<info_member> collection, int i) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<info_member> collection) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<info_member> collection, int i) {
        return false;
    }

    @Override
    public boolean removeById(Serializable serializable) {
        return false;
    }

    @Override
    public boolean removeByMap(Map<String, Object> map) {
        return false;
    }

    @Override
    public boolean remove(Wrapper<info_member> wrapper) {
        return false;
    }


    @Override
    public boolean updateById(info_member info_member) {
        return false;
    }

    @Override
    public boolean update(info_member info_member, Wrapper<info_member> wrapper) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<info_member> collection, int i) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(info_member info_member) {
        return false;
    }

    /**
     * 通过用户ID获取单条用户信息
     *
     * @param serializable
     * @return
     */
    @Override
    public info_member getById(Serializable serializable) {
        return memberMapper.selectById(serializable);
    }


    @Override
    public info_member getOne(Wrapper<info_member> wrapper, boolean b) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<info_member> wrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<info_member> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }


    @Override
    public List<info_member> list(Wrapper<info_member> wrapper) {
        return null;
    }


    @Override
    public List<Map<String, Object>> listMaps(Wrapper<info_member> wrapper) {
        return null;
    }

    @Override
    public List<Object> listObjs(Wrapper<info_member> wrapper) {
        return null;
    }

    @Override
    public BaseMapper<info_member> getBaseMapper() {
        return null;
    }

    @Override
    public Class<info_member> getEntityClass() {
        return null;
    }


}
